
{foreach $cols as $key=>$item }
{if(empty($item.type))}
<div class="layui-form-item" id="{$item.field}_div" style="{if(isset($item.style))}{$item.style}{/if}">
    <label class="layui-form-label">{$item.title}</label>
    <div class="layui-input-inline">
        <input class="layui-input {if(isset($item.readonly))}layui-disabled{/if}" id="{$item.field}" {if(isset($item.readonly))}readonly{/if} {if(isset($item.input_type))}type="{$item.input_type}"{/if}  placeholder="{$item.desc ?? $item.title}" type="text" {if(isset($item.required))}lay-verify="required"{/if}  name="{$item.field}"  value="{if( !empty($data[$item.field])) }{$data[$item.field]}{elseif(isset($item.value))}{$item.value}{/if}" >
    </div>
    {if(isset($item.show_user))}
    <div class="layui-form-mid layui-word-aux" id="user" style="display: none;">
        昵称 : <span id="nick_name"></span>
    </div>
    {/if}

</div>
{elseif($item.type == 'time')}
<div class="layui-form-item">
    <div class="layui-form">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">{$item.title}</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="time_start" name="{$item.field}" placeholder="yyyy-MM-dd">
                </div>
            </div>
        </div>
    </div>
</div>
{elseif($item.type == 'button')}
<div class="layui-form-item">
    <label class="layui-form-label">{$item.title}</label>
    <div class="layui-input-inline">
        <select  lay-filter="select" name="{$item.field}" id="{$item.field}" lay-verify="required">
            {foreach $item.option as $k => $val}
            {if condition="isset($item.default) AND $item.default==$val[0] "}
            <option value="{$val[0]}" selected>{$val[1]}</option>
            {else /}
            <option value="{$val[0]}">{$val[1]}</option>
            {/if}
            {/foreach}
        </select>
    </div>
</div>
{elseif($item.type == 'radio')}
<div class="layui-form-item">
    <label class="layui-form-label">{$item.title}</label>
    <div class="layui-input-block">
        {foreach $item.option as $k => $val}
        {if condition="isset($item.default) AND $item.default==$val[0] "}
        <input type="radio" checked name="{$item.field}" value="{$val[0]}" title="{$val[1]}"  lay-filter="radio">
        {else /}
        <input type="radio" name="{$item.field}" value="{$val[0]}" title="{$val[1]}"  lay-filter="radio">
        {/if}
        {/foreach}
    </div>
</div>
{elseif($item.type == 'fuwenben')}
<div class="layui-form-item" style="">
    <label class="layui-form-label">{$item.title}</label>
    <div class="layui-input-block">
        <textarea placeholder="{$item.title}" class="layui-textarea"  id="layeditDemo"  name="{$item.field}">{if( !empty($data[$item.field])) } {$data[$item.field]} {elseif(isset($item.value))} {$item.value} {/if}</textarea>
    </div>
    <div class="layui-form-mid layui-word-aux"></div>
</div>
{/if}
{/foreach}
{if( !empty($data.id)) }
<input type="hidden" name="id" value="{$data.id}">
{/if}